home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / GCC / CLIB / !clib / h / math < prev    next >
Text File  |  1997-04-06  |  3KB  |  91 lines

  1. /* math.h.  Mathematics for the Standard C Library.
  2.  
  3.    For use with the GNU compilers.
  4.    (c) Copyright 1997, Nick Burrett.  */
  5.  
  6. #ifndef __MATH_H
  7. #define __MATH_H
  8.  
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12.  
  13. #ifndef HUGE_VAL
  14. #define HUGE_VAL __huge_val
  15. extern const double HUGE_VAL;
  16. #endif
  17.  
  18. /* GCC has various useful declarations that can be made with the
  19.    __attribute__ syntax.  Disable its use for other compilers.  */
  20. #ifndef __GNUC__
  21. #ifndef __attribute__
  22. #define __attribute__(x) /* Ignore.  */
  23. #endif
  24. #endif
  25.  
  26. /* Trigonometric functions.  */
  27.  
  28. /* Arc cosine of x.  */
  29. extern double acos (double x) __attribute__ ((__const__));
  30. /* Arc sine of x.  */
  31. extern double asin (double x) __attribute__ ((__const__));
  32. /* Arc tangent of x.  */
  33. extern double atan (double x) __attribute__ ((__const__));
  34. /* Arc tangent of y/x.  */
  35. extern double atan2 (double y, double x) __attribute__ ((__const__));
  36.  
  37. /* Cosine of x.  */
  38. extern double cos (double x) __attribute__ ((__const__));
  39. /* Sine of x.  */
  40. extern double sin (double x) __attribute__ ((__const__));
  41. /* Tangent of x.  */
  42. extern double tan (double x) __attribute__ ((__const__));
  43.  
  44. /* Hyperbolic functions.  */
  45.  
  46. /* Hyperbolic cosine of x.  */
  47. extern double cosh (double x) __attribute__ ((__const__));
  48. /* Hyperbolic sine of x.  */
  49. extern double sinh (double x) __attribute__ ((__const__));
  50. /* Hyperbolic tangent of x.  */
  51. extern double tanh (double x) __attribute__ ((__const__));
  52.  
  53. /* Exponential and logarithmic functions.  */
  54.  
  55. /* Exponentional function of x.  */
  56. extern double exp (double x) __attribute__ ((__const__));
  57. /* Break value into a normalized fraction and an integral power of 2.  */
  58. extern double frexp (double value, int *exp);
  59. /* x times (two to the exp power).  */
  60. extern double ldexp (double x, int exp) __attribute__ ((__const__));
  61. /* Natural logarithm of x.  */
  62. extern double log (double x) __attribute__ ((__const__));
  63. /* Base-ten logarithm of x.  */
  64. extern double log10 (double x) __attribute__ ((__const__));
  65. /* Break value into integral and fractional parts.  */
  66. extern double modf (double value, double *integer);
  67.  
  68. /* Power functions.  */
  69.  
  70. /* Return x to the y power.  */
  71. extern double pow (double x, double y) __attribute__ ((__const__));
  72. /* Return the square root of x.  */
  73. extern double sqrt (double x) __attribute__ ((__const__));
  74.  
  75. /* Nearest integer, absolute value, and remainder functions.  */
  76.  
  77. /* Smallest integral value not less than X.  */
  78. extern double ceil (double x) __attribute__ ((__const__));
  79. /* Absolute value of X.  */
  80. extern double fabs (double x) __attribute__ ((__const__));
  81. /* Largest integer not greater than X.  */
  82. extern double floor (double x) __attribute__ ((__const__));
  83. /* Floating-point modulo remainder of X/Y.  */
  84. extern double fmod (double x, double y) __attribute__ ((__const__));
  85.  
  86. #ifdef __cplusplus
  87. }
  88. #endif
  89.  
  90. #endif
  91.